package com.product;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 *
 * 逻辑删除:
 *  1)配置全局删除规则
 *  2)Mybatis-Plus 3.1版本以前需要配置逻辑删除组件bean
 *  3)实体类上加入逻辑删除注解@TableLgic
 *
 *  8.整合SpringCache简化开发步骤
 *      1)引入依赖
 *          spring-boot-starter-cache spring-boot-starter-data-redis
 *      2)写配置
 *          (1)自动配置好了哪些
 *          CacheAutoConfiguration会导入RedisCacheConfiguration;
 *          自动配好了缓存管理器RedisCacheManager
 *          (2)配置使用redis作为缓存
 *      3)测试使用缓存注解
 *          @Cacheable:Trigger cache population 触发将数据保存到缓存的注解
 *          @CacheEvict:Trigger cache ebiction 触发将数据从缓存中删除的注解
 *          @CachePut:Update the cache without interfering with the method execution 不影响方法执行更新缓存
 *          @Caching: Regroups multiple cache operation to be applied on a method 组合以上多种操作
 *          @CacheConfing: Shares some common cache-related settings at class-level 在类级别共享缓存的相同配置
 *          1.开启缓存功能
 *          2.只需要使用注解就能完成缓存操作
 *       4)原理:
 *          CacheAutoConfiguration->RedisCacheConfiguration ->
 *          自动配置了RedisCacheConfiguration有就用自己的 没有就用默认配置
 *          想改缓存的配置 只需要给容器中放一个
 */
@EnableFeignClients(basePackages = "com.product.feign")
@MapperScan("com.product.dao")
@SpringBootApplication
@EnableDiscoveryClient
public class ProductApplication {

    public static void main(String[] args) {
        SpringApplication.run(ProductApplication.class, args);
    }

}
